package com.npave.zryhadapter.config;

import com.npave.zryhadapter.utils.JacksonUtil;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;
import java.util.Map;

/**
 * wechat mp properties
 *
 * @author <a href="https://github.com/binarywang">Binary Wang</a>
 */
@Data
@ConfigurationProperties(prefix = "wx.message")
public class WxMessageProperties {

    /**
     * 多个公众号配置信息
     */
    private List<Configs> configs;

    @Data
    public static class Configs {
        /**
         * 模板类型
         */
        private String name;

        /**
         * 模板ID
         */
        private String templateId;
        /**
         * 模板类容
         */
        private Map<String,String> dataMap;
    }

    @Override
    public String toString() {
        return JacksonUtil.toJsonStr(this);
    }
}
